package de.kardass.jsmatep.util;

public abstract class StringUtil {

	/**
	 * Checks whether a string is null or it's length (untrimmed) equals 0
	 * @param string
	 * @return
	 */
	public static boolean isEmpty(String string) {
		return string == null || string.trim().length() == 0;
	}

	/**
	 * Checks whether a string is not null and it's length (untrimmed) not equals 0
	 * @param string
	 * @return
	 */
	public static boolean isNotEmpty(String string) {
		return !isEmpty(string);
	}

	/**
	 * Checks whether a string is null or it's length (trimmed) equals 0
	 * @param string
	 * @return
	 */
	public static boolean isEmptyWithTrim(String string) {
		return string == null || string.trim().length() == 0;
	}

	/**
	 * Checks whether a string is not null and it's length (trimmed) not equals 0
	 * @param string
	 * @return
	 */
	public static boolean isNotEmptyWithTrim(String string) {
		return !isEmptyWithTrim(string);
	}

}
